
import com.jme3.app.SimpleApplication;
import com.jme3.app.state.AppStateManager;
import com.jme3.system.AppSettings;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.jme3.bullet.BulletAppState;

/**
 *
 * @author David Zhang
 */
public class Main extends SimpleApplication implements ScreenController{
    BulletAppState bulletAppState = new BulletAppState();
    
    public static void main(String[] args){
        Logger.getLogger("").setLevel(Level.SEVERE);
        AppSettings appSettings = new AppSettings(true);
        appSettings.setResolution(1024, 768);
        appSettings.setTitle("Shooter");
        Main app = new Main();
        app.setSettings(appSettings);
        app.setShowSettings(false);
        app.start();
    }

    @Override
    public void simpleInitApp() {
        stateManager.attach(bulletAppState);
        flyCam.setEnabled(false);
        guiNode.detachAllChildren();
        Gui gui = new Gui(assetManager, inputManager, audioRenderer, guiViewPort);
    }
    
    public void startClient(){
        Game game = new Game(false, stateManager, rootNode, assetManager, bulletAppState);
        flyCam.setEnabled(true);
    }
    
    public void startServer(){
        Gui.nifty.gotoScreen("comingsoon");
    }
    
    public void joinServer(){
        Gui.nifty.gotoScreen("comingsoon");
    }
    
    @Override public void bind(Nifty nifty, Screen screen) {}
    @Override public void onStartScreen() {}
    @Override public void onEndScreen() {}
    
}